home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / WordUp.dxr / UI elements_22.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  3.1 KB  |  119 lines

  1. global gWordList, gwordlist2, gtiles, gcols, wholelist, wholelist2, lilnum, cover, heylo
  2.  
  3. on createPuzzle
  4.   currentcount = 1
  5.   wholelist = [:]
  6.   repeat with i = 1 to gWordList[#across].count
  7.     if ilk(gWordList[#across][i], #propList) then
  8.       ass = fuckword(currentcount, gWordList[#across][i].wrd, i, getline(gWordList[#across][i].nbr))
  9.       lilnum[1].member.text = gWordList[#across][i].nbr.string
  10.       lilnum[1].loc = point(gtiles[currentcount].left, gtiles[currentcount].top)
  11.       lilnum.deleteAt(1)
  12.       currentcount = ass
  13.       next repeat
  14.     end if
  15.     if gWordList[#across][i] = #blackbox then
  16.       gtiles[currentcount].member = member("blackbox")
  17.       currentcount = currentcount + 1
  18.     end if
  19.   end repeat
  20.   wholelist2 = [:]
  21.   whipit()
  22.   cover.visible = 0
  23. end
  24.  
  25. on whipit
  26.   repeat with i = 1 to gwordlist2.count
  27.     ogd = the itemDelimiter
  28.     the itemDelimiter = "-"
  29.     arowcounta = gwordlist2[i].pos.item[1].value
  30.     acolcounta = gwordlist2[i].pos.item[2].value
  31.     the itemDelimiter = ogd
  32.     startposinc = (arowcounta * 15) - 15
  33.     startpos = acolcounta + startposinc
  34.     lilnum[1].member.text = string(gwordlist2[i].nbr)
  35.     lilnum[1].loc = point(gtiles[startpos].left.float, gtiles[startpos].top.float)
  36.     lilnum.deleteAt(1)
  37.     fuckitnow(startpos, gwordlist2[i].wrd, i)
  38.   end repeat
  39. end
  40.  
  41. on fuckitnow st, wo, thei
  42.   xS = 0
  43.   repeat with q = 1 to wo.char.count
  44.     ass = (q - 1) * 15
  45.     if (st + ass) > gtiles.count then
  46.       exit repeat
  47.     end if
  48.     gtiles[st + ass].ptilelist2 = []
  49.     repeat with you = 1 to wo.char.count
  50.       ade = (you - 1) * 15
  51.       if (st + ade) > gtiles.count then
  52.         exit repeat
  53.       end if
  54.       gtiles[st + ass].ptilelist2.add(gtiles[st + ade])
  55.     end repeat
  56.     xS = xS + 15
  57.   end repeat
  58.   wholelist2.addProp(gwordlist2[thei].nbr.string, gtiles[st].ptilelist2)
  59. end
  60.  
  61. on massacre
  62.   sweet = []
  63.   repeat with o = 1 to 15
  64.     ass = o
  65.     repeat while ass < gtiles.count
  66.       sweet.add(gtiles[ass])
  67.       ass = ass + 15
  68.     end repeat
  69.   end repeat
  70.   return sweet
  71. end
  72.  
  73. on findDown anum
  74.   repeat with shez = 1 to gWordList[#down].count
  75.     if gWordList[#down][shez].nbr = anum then
  76.       return shez
  77.     end if
  78.   end repeat
  79.   return VOID
  80. end
  81.  
  82. on gameEnd winornot
  83.   s = the ticks + 25
  84.   repeat while the ticks < s
  85.     updateStage()
  86.   end repeat
  87.   heylo = winornot
  88.   go("game over")
  89. end
  90.  
  91. on fuckword arg1, arg2, arg3, theques
  92.   xS = 0
  93.   repeat with q = 1 to arg2.char.count
  94.     gtiles[arg1 + xS].pchar = arg2.char[q]
  95.     gtiles[arg1 + xS].ptilelist = []
  96.     gtiles[arg1 + xS].myques = theques
  97.     repeat with you = arg1 to arg1 + arg2.char.count - 1
  98.       if you > gtiles.count then
  99.         exit repeat
  100.       end if
  101.       gtiles[arg1 + xS].ptilelist.add(gtiles[you])
  102.     end repeat
  103.     xS = xS + 1
  104.   end repeat
  105.   wholelist.addProp(gWordList[#across][arg3].nbr.string, gtiles[arg1].ptilelist)
  106.   return arg1 + arg2.char.count
  107. end
  108.  
  109. on getline arg
  110.   ogDelim = the itemDelimiter
  111.   the itemDelimiter = "."
  112.   repeat with yi = 1 to member("across questions").line.count
  113.     if member("across questions").line[yi].item[1] = arg then
  114.       return yi
  115.     end if
  116.   end repeat
  117.   the itemDelimiter = ogDelim
  118. end
  119.